<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<title>社团管理</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
	<link href="http://cdn.bootcss.com/animate.css/3.5.2/animate.min.css" rel="stylesheet" media="all">
	<link href="css/bootstrap-touch-slider.css" rel="stylesheet" media="all">
	<link rel="stylesheet" type="text/css" href="css/pc.css" />
	<link rel="stylesheet" type="text/css" media="screen and (max-width:1200px)" href="css/ipad.css">
	<link rel="stylesheet" type="text/css" media="screen and (max-width:768px)" href="css/phone.css">
	<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript" src="js/swiper.min.js"></script>
	<script type="text/javascript" src="js/scrollReveal.js"></script>
	<script src="http://cdn.bootcss.com/jquery.touchswipe/1.6.18/jquery.touchSwipe.min.js"></script>
	<script src="js/bootstrap-touch-slider-min.js"></script>
	<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=Diy1GpUowSnG4kyw93KWvG4GfQDm3xch"></script>

	<!-- 地区插件 -->
	<script src="js/distpicker.data.js"></script>	
	<script src="js/distpicker.js"></script>
	<script src="js/main.js"></script>	

	<script type="text/javascript" src="js/jquery.cookie.js"></script>
	<script type="text/javascript" src="js/base64.js"></script>
	<script type="text/javascript" src="js/xiuzhen.js"></script>
	<script>
		if ($(document.body).width() < 760) {
			document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
		} else {
			document.documentElement.style.fontSize = document.documentElement.clientWidth / 1 + 'px';
		}
	</script>
	<!--兼容ie8-->
	<!--[if lt IE 9]>
	    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
	    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

<body>
	<!-- 头部导航开始 -->
	<div class="header">
		<div class="nav">
			<img class="logo" src="images/logo.png" alt="">
			<ul class="top">
				<li class="active">
					<a href="javascript:;">首页</a>
				</li>
				<li>
					<a href="list.html">发现社团</a>
				</li>
				<li>
					<a href="new.html">社团快讯</a>
				</li>
				<li>
					<a href="activity.html">社团活动</a>
				</li>
				<li>
					<a href="contact.html">联系我们</a>
				</li>
			</ul>
			<div class="right">
				<a href="login.html" class="login">会员登陆</a>
				<a class="leaguer" href="member.html" style="display: none;">
					<img class="" src="images/people2.png" alt="">
				</a>
				<p id="username" style="display: none;"></p>
			</div>
		</div>
	</div>

	
	<!-- 子页面位置公共样式 -->
	<div class="com-position member-position">
		<p class="container">
			<span>当前页面：</span>
			<a href="">首页</a> >
			<a href="">会员中心</a>
		</p>
	</div>

	<!-- 个人中心页面 -->
	<div class="member">
		<div class="container">
			<div class="left">
				<div class="head">
					<p class="china">会员中心</p>
					<p class="eng">Member Center</p>
				</div>
				<ul class="menu">
					<li><a href="member.html">我的个人资料</a></li>	
					<li><a href="order.html">我的订单</a></li>
					<li><a href="address.html">我的收货地址</a></li>
					<li><a href="javascript:;" class="active">修改密码</a></li>
					<li class="loginOut"><a href="javascript:;">退出</a></li>
				</ul>
			</div>
			<div class="right">
				<div class="title">修改密码</div>
				<form action="" id="editPassword">
					<div class="editPassword">
						<div class="item">
							<p>当前密码</p>
							<input type="password" name="oldPassword" class="form-control oldPassword" placeholder="">
						</div>
						<div class="item">
							<p>新密码</p>
							<input type="password" name="newPassword" class="form-control newPassword" placeholder="">
						</div>
						<div class="item">
							<p>重复新密码</p>
							<input type="password" class="form-control checkPassword" placeholder="">
						</div>
						<div class="item">
							<a href="javascript:;" class="hold">保存</a>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>

	
	<!-- 公共底部开始 -->
	<div class="footer">
		<p class="copy">联系电话：18435165567</p>
		<p class="copy">联系邮箱：1056598469@qq.com</p>
		<p class="copy">地址：某某学校知行书院二单元一楼1501教室</p>
	</div>


	
	<script type="text/javascript">
		

		if(!$.cookie('uid')){
			location.href = 'index.html';
		}
	
		var loginUrl = Base64.encode("editPassword.html");  
		$('.header .nav .right .login').attr('href','./login.html?loginurl='+loginUrl);

		// 首页banner
		$('#bootstrap-touch-slider').bsTouchSlider();
		
		// 首页媒体报道
		var swiper = new Swiper('.swiper-container', {
			slidesPerView: 2,
			spaceBetween: 30,
			slidesPerGroup: 2,
			loop: true,
			loopFillGroupWithBlank: true,
			// pagination: {
			// 	el: '.swiper-pagination',
			// 	clickable: true,
			// },
			navigation: {
				nextEl: '.swiper-button-next',
				prevEl: '.swiper-button-prev',
			},
		});

		// 点击返回顶部
		$('.rightFrame .placement').on('click', function () {
			$("html,body").animate({
				scrollTop: 0
			}, 1000);
		});

		// 点击预约课程以及点击关闭弹框
		$('.rightFrame .bespoke').on('click', function () {
			$(".appointShadow").css("display","block");
			$(".appoint").css("display","block");
		});	
		$('.appoint .close').on('click', function () {
			$(".appointShadow").css("display","none");
			$(".appoint").css("display","none");
		});

		$("#editPassword .hold").click(function(){
			if($("#editPassword .oldPassword").val() == ""){
				$(".xz-alert").html("当前密码不能为空!");
				$('.xz-alert').show();
				setTimeout(function () {
					$(".xz-alert").hide();
				}, 2000);
			}else if($("#editPassword .newPassword").val() == ""){
				$(".xz-alert").html("新密码不能为空!");
				$('.xz-alert').show();
				setTimeout(function () {
					$(".xz-alert").hide();
				}, 2000);
			}else if($("#editPassword .checkPassword").val() == ""){
				$(".xz-alert").html("请重复新密码!");
				$('.xz-alert').show();
				setTimeout(function () {
					$(".xz-alert").hide();
				}, 2000);
			}else if($("#editPassword .oldPassword").val().length < 6 || $("#editPassword .newPassword").val().length < 6 || $("#editPassword .checkPassword").val().length < 6){
				$(".xz-alert").html("密码不能少于6位!");
				$('.xz-alert').show();
				setTimeout(function () {
					$(".xz-alert").hide();
				}, 2000);
			}else if($("#editPassword .checkPassword").val() != $("#editPassword .newPassword").val()){
				$(".xz-alert").html("两次输入的新密码不一致!");
				$('.xz-alert').show();
				setTimeout(function () {
					$(".xz-alert").hide();
				}, 2000);
			}else{
				$.ajax({
					type: "put",
					dataType: "json", // submit info
					url: url + '/v1/front/user/user/'+ $.cookie('uid') ,
					data:$("#editPassword").serializeArray(),
					contentType:"application/x-www-form-urlencoded",
					success: function (res) {
						if (!res.resultStatus) {
							$(".xz-alert").html(res.errorMessage);
							$('.xz-alert').show();
							setTimeout(function () {
								$(".xz-alert").hide();
							}, 2000);
							return
						}
						$(".xz-alert").html("修改成功！");
						$('.xz-alert').show();
						setTimeout(function () {
							$(".xz-alert").hide();
						}, 2000);
						$("#editPassword .oldPassword").val("");
						$("#editPassword .newPassword").val("");
						$("#editPassword .checkPassword").val(""); 
					},
					error: function (e) {
						$(".xz-alert").html("请求数据失败");
						$('.xz-alert').show();
						setTimeout(function () {
							$(".xz-alert").hide();
						}, 2000);
					}
			
				})
			}
			
		})
	</script>		

</body>

</html>